package com.sky.controller.admin;

import com.sky.result.Result;
import com.sky.service.ShopStatus;
import com.sky.service.ShoppingCartService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/shop")
@Api(tags = "店铺相关接口")
@Slf4j
public class ShopController {

    @Autowired
    ShopStatus service;

    /**
     * 获取店铺的状态
     * @return
     */
    @GetMapping("/status")
    @ApiOperation("店铺状态获取")
    public Result getStatus() {
        log.info("获取店铺的状态");
        Integer status = service.getStatus();
        return Result.success(status);
    }
    /**
     * 更改店铺状态
     */
    @PutMapping("/{status}")
    @ApiOperation("更改店铺状态")
    public Result changeStatus(@PathVariable Integer status){
        log.info("设置员工状态{}", status);
        service.setStatus(status);
        return Result.success();
    }
}

